{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8662b13f",
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_id = [10000,10001,10002,10003,10004,10005,10006,10007,10008,10009,10001,10\n",
    "# 如何取出所有位置的10001的index                                                        \n",
    "                                                                              \n",
    "# 1. copy()很重要                                                                \n",
    "# 思考, 赋值是真正的复制吗？ 赋值(=) <=> copy?                                              \n",
    "stu_id_matedata = stu_id                                                      \n",
    "print(\"stu_id:\",stu_id,'\\n','stu_id_matedata:',stu_id_matedata)               \n",
    "                                                                              \n",
    "#实1 copy()                                                                    \n",
    "stu_id_matedata = stu_id.copy()                                               \n",
    "stu_id.pop(1)                                                                 \n",
    "# print(\"stu_id:\",stu_id,'\\n','stu_id_matedata:',stu_id_matedata)             \n",
    "                                                                              \n",
    "#实2 赋值                                                                        \n",
    "# stu_id.pop(1)                                                               \n",
    "# print(\"stu_id:\",stu_id,'\\n','stu_id_matedata:',stu_id_matedata)             \n",
    "                                                                              \n",
    "#实3 切片实现复制                                                                    \n",
    "stu_id_matedata = stu_id[:]                                                   \n",
    "stu_id.pop(1)                                                                 \n",
    "# print(\"stu_id:\",stu_id,'\\n','stu_id_matedata:',stu_id_matedata)             "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
